package com.niuniu.rushdorm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.niuniu.rushdorm.pojo.entity.Groups;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface GroupsMapper extends BaseMapper<Groups> {

    @Override
    int insert(Groups groups);

    @Select("select * from `groups` where id = #{id} and is_del = 0")
    Groups selectById(int id);

    @Select("select * from `groups` where invite_code = #{inviteCode} and is_del = 0")
    Groups selectByInviteCode(String inviteCode);


    @Update("update `groups` set is_del = 1 where id = #{teamId}")
    int deleteGroup(int teamId);
}
